
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>qilu-task · 启路框架-使用手册</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-insert-logo/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-lightbox/css/lightbox.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-flexible-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    


    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="cache-readme.html" />
    
    
    <link rel="prev" href="baseReadme.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    整体介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../ready/ready.html">
            
                <a href="../ready/ready.html">
            
                    
                    技术准备
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../ready/ide.html">
            
                <a href="../ready/ide.html">
            
                    
                    eclipse
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../ready/build.html">
            
                <a href="../ready/build.html">
            
                    
                    本地构建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../ready/nexus.html">
            
                <a href="../ready/nexus.html">
            
                    
                    私服构建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../ready/run.html">
            
                <a href="../ready/run.html">
            
                    
                    运行调试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../ready/specification.html">
            
                <a href="../ready/specification.html">
            
                    
                    结构和分包
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="baseReadme.html">
            
                <a href="baseReadme.html">
            
                    
                    基础包介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.3.1" data-path="qiluTask-readme.html">
            
                <a href="qiluTask-readme.html">
            
                    
                    qilu-task
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="cache-readme.html">
            
                <a href="cache-readme.html">
            
                    
                    qilucache
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="qiluMybatis-readme.html">
            
                <a href="qiluMybatis-readme.html">
            
                    
                    qilu-mybatis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="logTrace-readme.html">
            
                <a href="logTrace-readme.html">
            
                    
                    qilu-logTrace
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="qilu-export-readme.html">
            
                <a href="qilu-export-readme.html">
            
                    
                    qilu-export
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="httpService-readme.html">
            
                <a href="httpService-readme.html">
            
                    
                    qilu-http-service
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="validateReadme.html">
            
                <a href="validateReadme.html">
            
                    
                    qilu-validate
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../state/state-course.html">
            
                <a href="../state/state-course.html">
            
                    
                    交易一致的由来
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../state/state-settle.html">
            
                <a href="../state/state-settle.html">
            
                    
                    qilu-state使用说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../state/state-demo.html">
            
                <a href="../state/state-demo.html">
            
                    
                    购买订单的处理示例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../backSample/backSampleReadme.html">
            
                <a href="../backSample/backSampleReadme.html">
            
                    
                    后台代码模板
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../backSample/security.html">
            
                <a href="../backSample/security.html">
            
                    
                    安全介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../backSample/deploy.html">
            
                <a href="../backSample/deploy.html">
            
                    
                    部署集成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../backSample/config.html">
            
                <a href="../backSample/config.html">
            
                    
                    spring配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../backSample/sso.html">
            
                <a href="../backSample/sso.html">
            
                    
                    SSO集成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../backSample/example.html">
            
                <a href="../backSample/example.html">
            
                    
                    常见代码示例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../test/readme.html">
            
                <a href="../test/readme.html">
            
                    
                    关于测试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../test/unitTest.html">
            
                <a href="../test/unitTest.html">
            
                    
                    单元测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../test/function.html">
            
                <a href="../test/function.html">
            
                    
                    功能测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../test/noFunction.html">
            
                <a href="../test/noFunction.html">
            
                    
                    非功能测试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../video/test.html">
            
                <a href="../video/test.html">
            
                    
                    视频
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../video/build.html">
            
                <a href="../video/build.html">
            
                    
                    项目构建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../video/state.html">
            
                <a href="../video/state.html">
            
                    
                    交易一致
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >qilu-task</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="qilu-task&#x4ECB;&#x7ECD;">qilu-task&#x4ECB;&#x7ECD;</h1>
<p>qilu-task&#x4E3B;&#x8981;&#x662F;&#x4E3A;&#x4E86;&#x6EE1;&#x8DB3;&#x9879;&#x76EE;&#x4E2D;&#x7684;&#x5404;&#x79CD;&#x5B9A;&#x65F6;&#x4EFB;&#x52A1;&#x7684;&#x9632;&#x5E76;&#x53D1;&#x673A;&#x5236;,&#x90FD;&#x5DF2;&#x7ECF;2020&#x5E74;&#x4E86;,&#x96BE;&#x9053;&#x4E00;&#x4E2A;&#x7CFB;&#x7EDF;&#x4E0A;&#x7EBF;,&#x56E0;&#x4E3A;&#x6709;&#x4E2A;&#x8DD1;P&#x7684;&#x4EFB;&#x52A1;,&#x6240;&#x4EE5;&#x8981;&#x9488;&#x5BF9;&#x8DD1;P&#x529F;&#x80FD;&#x5355;&#x72EC;&#x5F00;&#x53D1;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;,&#x5E76;&#x4E14;&#x548C;&#x8FD0;&#x7EF4;&#x540C;&#x5B66;&#x5546;&#x91CF;&#x597D;&quot;&#x8FD9;&#x4E2A;&#x5305;&#x53EA;&#x90E8;&#x7F72;&#x4E00;&#x53F0;&#x670D;&#x52A1;&#x5668;&quot;???</p>
<p>&#x6D41;&#x7A0B;&#x7684;&#x5B9E;&#x73B0;&#x6709;&#x7B80;&#x5355;&#x548C;&#x590D;&#x6742;&#x7684;&#x533A;&#x522B;,&#x590D;&#x6742;&#x7684;&#x6D41;&#x7A0B;&#x4E00;&#x822C;&#x90FD;&#x4F1A;&#x5305;&#x542B;&#x914D;&#x7F6E;&#x754C;&#x9762;,&#x5404;&#x79CD;&#x56FE;&#x5F62;&#x754C;&#x9762;,&#x65AD;&#x70B9;,&#x91CD;&#x8DD1;&#x4E4B;&#x7C7B;&#x7684;,&#x800C;&#x7B80;&#x5355;&#x7684;,&#x751A;&#x81F3;&#x90FD;&#x53EF;&#x4EE5;&#x4E0D;&#x8981;&#x6D41;&#x7A0B;&#x6A21;&#x578B;,&#x6BD4;&#x5982;&#x6211;&#x4EEC;&#x5F53;&#x524D;&#x7684;QiluTask&#x7684;&#x5B9E;&#x73B0;.&#x5F53;&#x6211;&#x4EEC;&#x53BB;&#x6389;&#x914D;&#x7F6E;&#x754C;&#x9762;&#x4EE5;&#x540E;,&#x6211;&#x4EEC;&#x540C;&#x6837;&#x53D1;&#x73B0;,&#x6574;&#x4E2A;&#x7684;&#x6D41;&#x7A0B;&#x6A21;&#x578B;&#x4E5F;&#x80FD;&#x53BB;&#x6389;,&#x6240;&#x4EE5;QiluTask&#x53EF;&#x4EE5;&#x88AB;&#x7528;&#x5728;&#x4E0D;&#x9700;&#x8981;&#x6D41;&#x7A0B;&#x7684;&#x4EA4;&#x6613;&#x7CFB;&#x7EDF;&#x7684;&#x5404;&#x79CD;&#x5F02;&#x6B65;&#x8865;&#x5355;&#x4E2D;.</p>
<p>&#x548C;quartz/spring-schedule&#x4E0D;&#x4E00;&#x6837;&#x7684;&#x5730;&#x65B9;&#x5728;&#x4E8E;,&#x6CA1;&#x6709;&#x89E6;&#x53D1;&#x63A7;&#x5236;,&#x53EA;&#x8D1F;&#x8D23;&#x6267;&#x884C;.&#x4F7F;&#x7528;&#x7B80;&#x5355;&#x7684;DB&#x5B58;&#x50A8;,&#x544A;&#x522B;quartz&#x7684;8&#x5F20;&#x8868;,&#x5177;&#x5907;&#x7B80;&#x5355;&#x7684;&#x53BB;&#x91CD;&#x529F;&#x80FD;,&#x6709;&#x65AD;&#x70B9;&#x6267;&#x884C;&#x529F;&#x80FD;,&#x4E3B;&#x8981;&#x662F;&#x901A;&#x8FC7;DB&#x7684;&#x673A;&#x5236;&#x6765;&#x9632;&#x5E76;&#x53D1;,&#x901A;&#x8FC7;&#x4FEE;&#x6539;&#x72B6;&#x6001;&#x6765;&#x5B9E;&#x73B0;&#x7B80;&#x5355;&#x7684;&#x4EFB;&#x52A1;&#x91CD;&#x8DD1;.</p>
<h2 id="&#x4E3B;&#x8981;&#x573A;&#x666F;">&#x4E3B;&#x8981;&#x573A;&#x666F;</h2>
<p>&#x9879;&#x76EE;&#x4E2D;&#x4F7F;&#x7528;&#x5230;qilu-task&#x7684;&#x573A;&#x666F;&#x4E3B;&#x8981;&#x6709;</p>
<ul>
<li>&#x540C;&#x4E00;&#x4E2A;&#x9879;&#x76EE;&#x90E8;&#x7F72;&#x591A;&#x53F0;&#x670D;&#x52A1;&#x5668;,&#x6BCF;&#x53F0;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x90FD;&#x6709;&#x5B9A;&#x65F6;&#x4EFB;&#x52A1;,&#x53EA;&#x5E0C;&#x671B;&#x6709;&#x5176;&#x4E2D;1&#x53F0;&#x673A;&#x5668;&#x6267;&#x884C;&#x4EFB;&#x52A1;</li>
<li>&#x9879;&#x76EE;&#x4E2D;&#x7684;&#x5F02;&#x6B65;&#x8865;&#x5355;&#x673A;&#x5236;</li>
<li>&#x6700;&#x6700;&#x8F7B;&#x91CF;&#x7EA7;&#x7684;&#x4EFB;&#x52A1;&#x5B9E;&#x73B0;,&#x6CA1;&#x6709;&#x4E4B;&#x4E00;,&#x9AD8;&#x5EA6;&#x805A;&#x5408;,&#x7B80;&#x5355;&#x800C;&#x5F3A;&#x5927;,&#x5BF9;&#x4E8E;&#x9879;&#x76EE;&#x4E2D;&#x7684;&#x8865;&#x5355;&#x64CD;&#x4F5C;,&#x7B80;&#x5355;&#x7684;&#x8DD1;&#x6279;&#x64CD;&#x4F5C;,&#x9519;&#x9519;&#x6709;&#x4F59;.</li>
<li>&#x9488;&#x5BF9;&#x4EFB;&#x52A1;&#x521B;&#x5EFA;,&#x9700;&#x8981;&#x5177;&#x5907;&#x552F;&#x4E00;&#x7684;&#x6807;&#x8BC6;(&#x4EFB;&#x52A1;&#x7C7B;&#x578B;+&#x4EFB;&#x52A1;&#x53F7;),&#x8FD9;&#x4E2A;&#x6807;&#x8BC6;&#x4E5F;&#x5177;&#x5907;&#x9632;&#x91CD;&#x590D;&#x529F;&#x80FD;, &#x63A7;&#x5236;&#x4EFB;&#x52A1;&#x7684;&#x6267;&#x884C;</li>
<li>&#x6709;&#x6301;&#x4E45;,&#x6709;&#x65AD;&#x70B9;,&#x80FD;&#x91CD;&#x8BD5;</li>
</ul>
<h2 id="&#x4EE3;&#x7801;&#x96C6;&#x6210;">&#x4EE3;&#x7801;&#x96C6;&#x6210;</h2>
<h3 id="maven&#x4F9D;&#x8D56;">maven&#x4F9D;&#x8D56;</h3>
<pre class="language-"><code class="lang-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>com.9istock.base<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>qilu-task<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span>1.0.0<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>version</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<h3 id="&#x6267;&#x884C;&#x811A;&#x672C;">&#x6267;&#x884C;&#x811A;&#x672C;</h3>
<p>&#x6267;&#x884C;&#x6570;&#x636E;&#x5E93;&#x7684;&#x521D;&#x59CB;&#x5316;&#x8BED;&#x53E5;(sql/create-*.sql)</p>
<h3 id="spring&#x914D;&#x7F6E;">spring&#x914D;&#x7F6E;</h3>
<pre class="language-"><code class="lang-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>bean</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>dataSource<span class="token punctuation">&quot;</span></span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>org.apache.commons.dbcp.BasicDataSource<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>driverClassName<span class="token punctuation">&quot;</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>org.gjt.mm.mysql.Driver<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>url<span class="token punctuation">&quot;</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>jdbc:mysql://senvon.vm:3306/new-user?useUnicode=true<span class="token entity" title="&amp;">&amp;amp;</span>characterEncoding=UTF-8<span class="token entity" title="&amp;">&amp;amp;</span>autoReconnect=true<span class="token entity" title="&amp;">&amp;amp;</span>zeroDateTimeBehavior=convertToNull<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>username<span class="token punctuation">&quot;</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>root<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>password<span class="token punctuation">&quot;</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>123<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>bean</span><span class="token punctuation">&gt;</span></span>

<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>bean</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>qiluTaskDAO<span class="token punctuation">&quot;</span></span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>com.istock.base.task.dao.QiluTaskDAO<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>datasource<span class="token punctuation">&quot;</span></span> <span class="token attr-name">ref</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>dataSource<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>property</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>bean</span><span class="token punctuation">&gt;</span></span>

<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>bean</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>qiluTaskService<span class="token punctuation">&quot;</span></span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>com.istock.base.task.service.QiluTaskService<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token comment">&lt;!--&#x914D;&#x7F6E;&#x5F02;&#x6B65;&#x6267;&#x884C;&#x7684;&#x7EBF;&#x7A0B;&#x6570;--&gt;</span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>asynThreadCount<span class="token punctuation">&quot;</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>10<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>property</span><span class="token punctuation">&gt;</span></span>
    <span class="token comment">&lt;!--&#x914D;&#x7F6E;&#x672A;&#x5B8C;&#x6210;&#x4EFB;&#x52A1;&#x626B;&#x63CF;&#x7EBF;&#x7A0B;&#x6570;--&gt;</span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>compensateThreadCount<span class="token punctuation">&quot;</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>2<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>property</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>bean</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<p>&#x6709;&#x4E00;&#x4E9B;&#x7EC6;&#x8282;&#x9700;&#x8981;&#x6CE8;&#x610F;</p>
<ul>
<li>qiluTask&#x4F9D;&#x8D56;&#x4E8E;&#x6570;&#x636E;&#x5E93;,&#x6240;&#x4EE5;&#x5728;&#x6CE8;&#x518C;dao&#x7684;&#x65F6;&#x5019;,&#x9700;&#x8981;&#x6570;&#x636E;&#x6E90;</li>
<li>tableName,&#x5F53;&#x4E00;&#x4E2A;&#x9879;&#x76EE;,&#x51FA;&#x73B0;&#x8868;&#x51B2;&#x7A81;&#x7684;&#x65F6;&#x5019;,&#x53EF;&#x4EE5;&#x53E6;&#x5916;&#x4F7F;&#x7528;&#x989D;&#x5916;&#x7684;&#x8868;,&#x9ED8;&#x8BA4;&#x503C;&#x662F;AUTO_TASK</li>
<li>qiluTaskService&#x662F;qilutask&#x7684;&#x64CD;&#x4F5C;&#x7C7B;,&#x53EF;&#x4EE5;&#x6307;&#x5B9A;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x6570;</li>
<li>asynThreadCount,&#x914D;&#x7F6E;&#x5F02;&#x6B65;&#x6267;&#x884C;&#x7684;&#x7EBF;&#x7A0B;&#x6570;,&#x9ED8;&#x8BA4;&#x662F;20</li>
<li>compenstaeThreadCount,&#x662F;&#x91CD;&#x8DD1;&#x7EBF;&#x7A0B;&#x6570;,&#x9ED8;&#x8BA4;&#x662F;2</li>
</ul>
<h3 id="&#x5B9A;&#x65F6;&#x8C03;&#x5EA6;">&#x5B9A;&#x65F6;&#x8C03;&#x5EA6;</h3>
<p>&#x4F7F;&#x7528;spring-task,&#x6765;&#x89E6;&#x53D1;&#x5B9A;&#x65F6;&#x4EFB;&#x52A1;</p>
<pre class="language-"><code class="lang-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token namespace">task:</span>scheduler</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>taskScheduler<span class="token punctuation">&quot;</span></span> <span class="token attr-name">pool-size</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>10<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token namespace">task:</span>scheduled-tasks</span> <span class="token attr-name">scheduler</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>taskScheduler<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token comment">&lt;!-- &#x6BCF;&#x9694;1&#x5206;&#x949F;&#x68C0;&#x67E5;&#x5728;&#x7EBF;&#x7528;&#x6237;&#x91CC;&#x9762;&#x662F;&#x5426;&#x6709;&#x5B58;&#x5728;&#x8D85;&#x65F6;&#x7684;&#x4FE1;&#x606F;,&#x6709;&#x5C31;&#x6E05;&#x9664;&#x6389; --&gt;</span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token namespace">task:</span>scheduled</span> <span class="token attr-name">ref</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>UserOnlineTask<span class="token punctuation">&quot;</span></span> <span class="token attr-name">method</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>addClearOnlineExpireTask<span class="token punctuation">&quot;</span></span> <span class="token attr-name">cron</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>23 0/1 * * * ?<span class="token punctuation">&quot;</span></span><span class="token punctuation">/&gt;</span></span>
        <span class="token comment">&lt;!-- &#x6BCF;&#x9694;3&#x5206;&#x949F;&#x68C0;&#x67E5;&#x4E00;&#x4E0B;&#x6570;&#x636E;&#x5E93;&#x8FD8;&#x6709;&#x6CA1;&#x6709;&#x672A;&#x5B8C;&#x6210;&#x7684;&#x4EFB;&#x52A1;,&#x5982;&#x679C;&#x6709;,&#x5C31;&#x6267;&#x884C; --&gt;</span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token namespace">task:</span>scheduled</span> <span class="token attr-name">ref</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>qiluTaskService<span class="token punctuation">&quot;</span></span> <span class="token attr-name">method</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>compensateNotCompleteTask<span class="token punctuation">&quot;</span></span> <span class="token attr-name">cron</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>13 0/3 * * * ?<span class="token punctuation">&quot;</span></span><span class="token punctuation">/&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span><span class="token namespace">task:</span>scheduled-tasks</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<blockquote>
<p><strong style="color:red">compensateNotCompleteTask</strong>&#x8FD9;&#x4E2A;&#x89E6;&#x53D1;,&#x662F;&#x6307;&#x6BCF;&#x9694;3&#x5206;&#x949F;,&#x8F6E;&#x8BE2;&#x6570;&#x636E;&#x5E93;&#x91CC;&#x9762;&#x6267;&#x884C;&#x5B8C;&#x6210;&#x7684;&#x4EFB;&#x52A1;,&#x91CD;&#x65B0;&#x6267;&#x884C;.</p>
</blockquote>
<h3 id="&#x5E38;&#x7528;&#x65B9;&#x6CD5;&#x8BF4;&#x660E;">&#x5E38;&#x7528;&#x65B9;&#x6CD5;&#x8BF4;&#x660E;</h3>
<p>&#x5728;QiluTaskService&#x4E2D;,&#x66B4;&#x9732;&#x5982;&#x4E0B;&#x51E0;&#x4E2A;&#x65B9;&#x6CD5;</p>
<pre class="language-"><code class="lang-java"><span class="token comment">/**&#x65B0;&#x589E;&#x4E00;&#x4E2A;&#x4EFB;&#x52A1;
     * @param taskType &#x5B9A;&#x4E49;&#x7684;&#x4E00;&#x4E2A;&#x4EFB;&#x52A1;&#x7C7B;&#x578B;
     * @param taskNo &#x5B9A;&#x4E49;&#x7684;&#x4E00;&#x4E2A;&#x4EFB;&#x52A1;&#x7F16;&#x53F7;
     * @param invokeMethod &#x9700;&#x8981;&#x88AB;&#x6267;&#x884C;&#x7684;&#x7C7B;&#x548C;&#x65B9;&#x6CD5;,&#x8BF7;&#x9075;&#x5FAA;&#x683C;&#x5F0F;,spring:beanId.methodName,&#x5982;spring:UserOnlineTask.clearOnlineExpireHandler
     * @param context &#x4F20;&#x9012;&#x7ED9;&#x6267;&#x884C;&#x5668;&#x7684;&#x4E0A;&#x4E0B;&#x6587;&#x53C2;&#x6570;
     * @param firstExecDelaySeconds &#x7B2C;&#x4E00;&#x6B21;&#x6267;&#x884C;&#x7684;&#x7B49;&#x5F85;&#x65F6;&#x95F4;,&#x9002;&#x7528;&#x4E8E;&#x81EA;&#x52A8;&#x8C03;&#x7528;,&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x795E;&#x5947;&#x7684;&#x5B57;&#x6BB5;
     * @param execExpireMinute &#x6267;&#x884C;&#x7684;&#x8D85;&#x65F6;&#x65F6;&#x95F4;,&#x5355;&#x4F4D;&#x5206;&#x949F;
     * @param maxExecTimes &#x6700;&#x5927;&#x7684;&#x6267;&#x884C;&#x6B21;&#x6570;,&#x6709;&#x9ED8;&#x8BA4;&#x6709;&#x9519;&#x8BEF;&#x91CD;&#x8BD5;,&#x8D85;&#x8FC7;&#x8BE5;&#x6570;&#x503C;&#x5C31;&#x4E0D;&#x4F1A;&#x518D;&#x91CD;&#x8BD5;
     * @param taskList &#x5F53;&#x524D;&#x4EFB;&#x52A1;&#x7684;&#x4F9D;&#x8D56;,&#x6CA1;&#x6709;&#x4F9D;&#x8D56;&#x53EF;&#x4EE5;&#x4E3A;null
     * @throws DuplicateTaskException &#x5982;&#x679C;&#x5B58;&#x5728;&#x540C;&#x4E00;&#x4E2A;&#x4EFB;&#x52A1;&#x7C7B;&#x578B;&#x4E2D;,taskNo&#x6709;&#x91CD;&#x590D;,&#x5C31;&#x4F1A;&#x51FA;&#x73B0;&#x8BE5;&#x5F02;&#x5E38;
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">addQiluTask</span><span class="token punctuation">(</span><span class="token class-name">String</span> taskType<span class="token punctuation">,</span> <span class="token class-name">String</span> taskNo<span class="token punctuation">,</span>
            <span class="token class-name">String</span> invokeMethod<span class="token punctuation">,</span> <span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span><span class="token punctuation">,</span> <span class="token class-name">String</span><span class="token punctuation">&gt;</span></span> context<span class="token punctuation">,</span>
            <span class="token keyword">int</span> firstExecDelaySeconds<span class="token punctuation">,</span> <span class="token keyword">int</span> execExpireMinute<span class="token punctuation">,</span> <span class="token keyword">int</span> maxExecTimes <span class="token punctuation">,</span> <span class="token class-name">Set</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">OneTask</span><span class="token punctuation">&gt;</span></span> taskList<span class="token punctuation">)</span>
</code></pre>
<blockquote>
<p>&#x65B0;&#x589E;&#x4E00;&#x4E2A;&#x4EFB;&#x52A1;,&#x5982;&#x679C;&#x6709;&#x91CD;&#x590D;,&#x5219;&#x4F1A;&#x629B;&#x51FA;&#x5F02;&#x5E38;.</p>
</blockquote>
<pre class="language-"><code class="lang-java"><span class="token comment">/**&#x540C;&#x6B65;&#x6267;&#x884C;&#x4E00;&#x4E2A;&#x4EFB;&#x52A1;
     * @param taskType &#x4EFB;&#x52A1;&#x7C7B;&#x578B;
     * @param taskNo &#x4EFB;&#x52A1;&#x7F16;&#x53F7;
     * @return &#x6267;&#x884C;&#x7ED3;&#x679C;
     * @throws LockingTaskFailedException &#x9501;&#x5931;&#x8D25;&#x5F02;&#x5E38;
     */</span>
    <span class="token keyword">public</span> <span class="token class-name">SyncTaskResult</span> <span class="token function">syncExecuteTask</span><span class="token punctuation">(</span><span class="token class-name">String</span> taskType<span class="token punctuation">,</span> <span class="token class-name">String</span> taskNo<span class="token punctuation">)</span>    <span class="token keyword">throws</span> <span class="token class-name">LockingTaskFailedException</span>
</code></pre>
<blockquote>
<p>&#x540C;&#x6B65;&#x6267;&#x884C;,&#x4F1A;&#x4F7F;&#x7528;&#x5F53;&#x524D;&#x8C03;&#x7528;&#x65B9;&#x6CD5;&#x7684;&#x7EBF;&#x7A0B;,&#x5E76;&#x7B49;&#x5F85;&#x6267;&#x884C;&#x7ED3;&#x679C;,&#x4F1A;&#x963B;&#x585E;&#x5F53;&#x524D;&#x7EBF;&#x7A0B;&#x7684;&#x6267;&#x884C;</p>
</blockquote>
<pre class="language-"><code class="lang-java"><span class="token comment">/**&#x5F02;&#x6B65;&#x6267;&#x884C;&#x4E00;&#x4E2A;&#x4EFB;&#x52A1;
     * @param taskType
     * @param taskNo
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">asynExecuteTask</span><span class="token punctuation">(</span><span class="token keyword">final</span> <span class="token class-name">String</span> taskType<span class="token punctuation">,</span> <span class="token keyword">final</span> <span class="token class-name">String</span> taskNo<span class="token punctuation">)</span>
</code></pre>
<blockquote>
<p>&#x5F02;&#x6B65;&#x6267;&#x884C;,&#x6CA1;&#x6709;&#x8FD4;&#x56DE;&#x503C;.</p>
</blockquote>
<h3 id="handler&#x7684;&#x5B9E;&#x73B0;">handler&#x7684;&#x5B9E;&#x73B0;</h3>
<pre class="language-"><code class="lang-java"><span class="token comment">/**
*  &#x5728;&#x589E;&#x52A0;&#x7684;&#x4EFB;&#x52A1;&#x91CC;&#x9762;,&#x9700;&#x8981;&#x88AB;&#x56DE;&#x8C03;&#x7684;&#x65B9;&#x6CD5;
*  TaskExecResult,&#x662F;&#x5F53;&#x524D;&#x4EFB;&#x52A1;&#x7684;&#x8FD4;&#x56DE;&#x503C;,&#x5982;&#x679C;&#x5728;&#x65B0;&#x589E;&#x4EFB;&#x52A1;&#x7684;&#x65F6;&#x5019;,&#x6709;&#x4F20;&#x5165;&#x6267;&#x884C;&#x6B21;&#x6570;,&#x5141;&#x8BB8;&#x5F53;&#x524D;&#x4EFB;&#x52A1;&#x8FD4;&#x56DE;&#x5931;&#x8D25;
*  &#x8FD4;&#x56DE;true,&#x4EE3;&#x8868;&#x5F53;&#x524D;&#x4EFB;&#x52A1;&#x6267;&#x884C;&#x6210;&#x529F;,&#x540E;&#x7EED;&#x4E5F;&#x4E0D;&#x4F1A;&#x518D;&#x6267;&#x884C;
*  &#x5165;&#x53C2;TaskExecContext,&#x662F;&#x5728;&#x521B;&#x5EFA;&#x4EFB;&#x52A1;&#x7684;&#x65F6;&#x5019;,&#x9700;&#x8981;&#x88AB;&#x4F20;&#x5165;&#x7684;&#x4EFB;&#x52A1;&#x53C2;&#x6570;,&#x8FD9;&#x4E2A;&#x53C2;&#x6570;&#x4EE5;JSON&#x7684;&#x65B9;&#x5F0F;&#x6301;&#x4E45;&#x5728;&#x6570;&#x636E;&#x5E93;&#x7684;CONTEXT_PARAM&#x5B57;&#x6BB5;&#x4E2D;
*/</span>
<span class="token keyword">public</span> <span class="token class-name">TaskExecResult</span> <span class="token function">clearOnlineExpireHandler</span><span class="token punctuation">(</span><span class="token class-name">TaskExecContext</span> context<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    logger<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string">&quot;ready to execute user online expire clear task===============&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">int</span> count <span class="token operator">=</span> userOnlineInfoService<span class="token punctuation">.</span><span class="token function">clearExpireToken</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    logger<span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span><span class="token string">&quot;end for execute user online expire clear task , delete {} record===============&quot;</span> <span class="token punctuation">,</span> count<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token keyword">new</span> <span class="token class-name">TaskExecResult</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<p>handler&#x7684;&#x65B9;&#x6CD5;&#x58F0;&#x660E;,&#x5FC5;&#x987B;&#x548C;&#x4E0A;&#x8FF0;&#x793A;&#x4F8B;&#x4FDD;&#x6301;&#x4E00;&#x81F4;.</p>
<p>TaskExecResult&#x662F;handler&#x7684;&#x8FD4;&#x56DE;&#x503C;,&#x6784;&#x9020;&#x51FD;&#x6570;&#x4E2D;&#x7684;boolean&#x53C2;&#x6570;,&#x5982;&#x679C;&#x8FD4;&#x56DE;true,&#x4EE3;&#x8868;&#x5F53;&#x524D;&#x4EFB;&#x52A1;&#x6267;&#x884C;&#x6210;&#x529F;,&#x5982;&#x679C;&#x8FD4;&#x56DE;false,&#x5219;&#x4EE3;&#x8868;&#x6267;&#x884C;&#x5931;&#x8D25;.</p>
<p>&#x6267;&#x884C;&#x6210;&#x529F;&#x7684;&#x4EFB;&#x52A1;,&#x5728;&#x6267;&#x884C;&#x5B8C;&#x4EE5;&#x540E;,SYS_QILU_TASK&#x8868;&#x4E2D;&#x7684;&#x4EFB;&#x52A1;&#x72B6;&#x6001;&#x4F1A;&#x53D8;&#x66F4;&#x4E3A;complete,&#x5982;&#x679C;&#x6267;&#x884C;&#x5931;&#x8D25;,&#x540E;&#x7EED;&#x4F1A;&#x7B49;&#x5F85;&#x91CD;&#x8DD1;&#x4EFB;&#x52A1;&#x6267;&#x884C;,&#x8FDB;&#x884C;&#x91CD;&#x8DD1;.</p>
<h3 id="&#x5176;&#x4ED6;">&#x5176;&#x4ED6;</h3>
<h4 id="&#x4EFB;&#x52A1;&#x7684;&#x72B6;&#x6001;">&#x4EFB;&#x52A1;&#x7684;&#x72B6;&#x6001;</h4>
<table>
<thead>
<tr>
<th>&#x72B6;&#x6001;</th>
<th>&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>WAITING_EXECUTE</td>
<td>&#x521A;&#x521A;&#x63D2;&#x5165;,&#x7B49;&#x5F85;&#x6267;&#x884C;</td>
</tr>
<tr>
<td>EXECUTING</td>
<td>&#x6267;&#x884C;&#x4E2D;,&#x901A;&#x8FC7;&#x72B6;&#x6001;&#x6765;&#x505A;&#x7684;&#x4E50;&#x89C2;&#x9501;</td>
</tr>
<tr>
<td>COMPLETE</td>
<td>&#x5DF2;&#x5B8C;&#x6210;</td>
</tr>
<tr>
<td>NOT_RETRY</td>
<td>&#x5931;&#x8D25;,&#x8D85;&#x8FC7;&#x91CD;&#x8BD5;&#x6B21;&#x6570;,&#x4E0D;&#x518D;&#x91CD;&#x8BD5;</td>
</tr>
</tbody>
</table>
<p>&#x5982;&#x679C;&#x4E00;&#x4E2A;&#x4EFB;&#x52A1;&#x4EE5;QiluTask&#x6267;&#x884C;,&#x540E;&#x7EED;&#x9700;&#x8981;&#x91CD;&#x8DD1;,&#x53EA;&#x9700;&#x8981;&#x5728;&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x628A;&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x7684;&#x72B6;&#x6001;&#x8BBE;&#x7F6E;&#x4E3A;WAITING_EXECUTE,&#x540C;&#x65F6;&#x8BBE;&#x7F6E;EXECUTED_TIME,&#x4E0D;&#x8981;&#x8BA9;&#x91CD;&#x8DD1;&#x8D85;&#x8FC7;&#x6B21;&#x6570;</p>
<h4 id="&#x4EFB;&#x52A1;&#x6267;&#x884C;">&#x4EFB;&#x52A1;&#x6267;&#x884C;</h4>
<p>&#x4EFB;&#x52A1;&#x7684;&#x6267;&#x884C;,&#x4E3B;&#x8981;&#x662F;&#x53C2;&#x8003;taskService&#x7684;&#x6267;&#x884C;&#x65B9;&#x6CD5;,&#x53EA;&#x8981;&#x6267;&#x884C;&#x65B9;&#x6CD5;&#x88AB;&#x8C03;&#x7528;,&#x4EFB;&#x52A1;&#x5C31;&#x4F1A;&#x6267;&#x884C;.&#x53E6;&#x5916;,qiluTask&#x81EA;&#x5DF1;&#x6709;&#x72EC;&#x7ACB;&#x7684;&#x8865;&#x5355;&#x4EFB;&#x52A1;,&#x8865;&#x5355;&#x4EFB;&#x52A1;&#x4F1A;&#x4F9D;&#x8D56;&#x4E8E;&#x65F6;&#x95F4;&#x6267;&#x884C;.</p>
<p>&#x8865;&#x5355;&#x4EFB;&#x52A1;&#x4F1A;&#x68C0;&#x7D22;SYS_QILU_TASK&#x8868;&#x4E2D;&#x7684;NEXT_EXEC_TIME&#x548C;TASK_STATE,&#x6EE1;&#x8DB3;&#x4EE5;&#x540E;&#x624D;&#x4F1A;&#x88AB;&#x8865;&#x5355;.
&#x68C0;&#x67E5;&#x4F9D;&#x8D56;&#x5931;&#x8D25;,&#x4E0D;&#x4F1A;&#x589E;&#x52A0;&#x6267;&#x884C;&#x6B21;&#x6570;</p>
<h2 id="&#x4F7F;&#x7528;&#x573A;&#x666F;">&#x4F7F;&#x7528;&#x573A;&#x666F;</h2>
<h3 id="&#x4EA4;&#x6613;&#x8865;&#x5355;">&#x4EA4;&#x6613;&#x8865;&#x5355;</h3>
<p>&#x5047;&#x8BBE;&#x6211;&#x4EEC;&#x7684;&#x9700;&#x6C42;&#x662F;,&#x5904;&#x7406;&#x4E00;&#x4E2A;&#x8BA2;&#x5355;,&#x8FD9;&#x4E2A;&#x8BA2;&#x5355;&#x9700;&#x8981;&#x5165;&#x8D26;,&#x540C;&#x65F6;&#x4FDD;&#x5B58;&#x5165;&#x8D26;&#x7ED3;&#x679C;.&#x4F46;&#x662F;&#x7531;&#x4E8E;&#x5404;&#x79CD;&#x539F;&#x56E0;,&#x5165;&#x8D26;&#x4E0D;&#x4E00;&#x5B9A;&#x662F;&#x540C;&#x6B65;&#x7684;,&#x6709;&#x7684;&#x65F6;&#x5019;&#x8D26;&#x52A1;&#x7CFB;&#x7EDF;&#x4F1A;&#x8FD4;&#x56DE;&quot;&#x5904;&#x7406;&#x4E2D;&quot;&#x6216;&#x8005;&#x5B8C;&#x5168;&#x6CA1;&#x54CD;&#x5E94;.&#x8FD9;&#x4E2A;&#x65F6;&#x5019;,&#x5C31;&#x9700;&#x8981;&#x8865;&#x5355;&#x64CD;&#x4F5C;,&#x6211;&#x4EEC;&#x7684;&#x8BA2;&#x5355;&#x5904;&#x7406;&#x7684;&#x903B;&#x8F91;&#x5982;&#x4E0B;:</p>
<pre class="language-"><code class="lang-java"><span class="token keyword">public</span> result &#x8BA2;&#x5355;&#x5904;&#x7406;<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token keyword">try</span><span class="token punctuation">{</span>
        &#x9501;<span class="token punctuation">(</span>&#x8BA2;&#x5355;<span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            @&#x4E8B;&#x52A1;
            <span class="token punctuation">{</span>
                &#x8BA2;&#x5355;&#x72B6;&#x6001;&#x66F4;&#x65B0;
            <span class="token punctuation">}</span>
            &#x5165;&#x8D26;&#x7ED3;&#x679C; <span class="token operator">=</span> &#x8C03;&#x7528;&#x5165;&#x8D26;<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">if</span><span class="token punctuation">(</span>&#x5165;&#x8D26;&#x7ED3;&#x679C; <span class="token operator">!=</span> <span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
                @&#x4E8B;&#x52A1;
                <span class="token punctuation">{</span>
                    &#x4FDD;&#x5B58;&#x8BA2;&#x5355;<span class="token punctuation">(</span>&#x5165;&#x8D26;&#x7ED3;&#x679C;<span class="token punctuation">)</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span><span class="token keyword">else</span><span class="token punctuation">{</span>

                @&#x4E8B;&#x52A1;
                <span class="token punctuation">{</span>
                    <span class="token class-name">Map</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span> <span class="token punctuation">,</span> <span class="token class-name">String</span><span class="token punctuation">&gt;</span></span> context <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">HashMap</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token class-name">String</span> <span class="token punctuation">,</span> <span class="token class-name">String</span><span class="token punctuation">&gt;</span></span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    context<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span><span class="token string">&quot;orderNo&quot;</span> <span class="token punctuation">,</span> &#x8BA2;&#x5355;&#x53F7;<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    context<span class="token punctuation">.</span><span class="token function">put</span><span class="token punctuation">(</span><span class="token string">&quot;accountRequestNo&quot;</span> <span class="token punctuation">,</span> &#x5165;&#x8D26;&#x8BF7;&#x6C42;&#x53F7;<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token keyword">try</span><span class="token punctuation">{</span>
                        qiluTaskService<span class="token punctuation">.</span><span class="token function">addTask</span><span class="token punctuation">(</span><span class="token string">&quot;xxx&#x8BA2;&#x5355;-&#x8865;&#x5355;&quot;</span><span class="token punctuation">,</span>&#x8BA2;&#x5355;&#x53F7; <span class="token punctuation">,</span><span class="token string">&quot;&#x6267;&#x884C;handler&quot;</span><span class="token punctuation">,</span> <span class="token punctuation">,</span><span class="token number">5</span> <span class="token punctuation">,</span> <span class="token number">5</span> <span class="token punctuation">,</span> <span class="token number">5</span> <span class="token punctuation">,</span> <span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token punctuation">}</span><span class="token keyword">catch</span><span class="token punctuation">(</span><span class="token class-name">Exception</span><span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token punctuation">}</span>
                <span class="token punctuation">}</span>

            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#x4E0A;&#x9762;&#x7684;&#x793A;&#x4F8B;&#x4EE3;&#x7801;&#x662F;&#x5E38;&#x89C1;&#x7684;&#x4E00;&#x4E2A;&#x4EA4;&#x6613;&#x5165;&#x8D26;&#x7684;&#x5B9E;&#x73B0;,&#x6709;&#x4E9B;&#x4E8B;&#x60C5;&#x9700;&#x8981;&#x6CE8;&#x610F;</p>
<ul>
<li>&#x8C03;&#x7528;&#x5165;&#x8D26;&#x5982;&#x679C;&#x662F;&#x4E00;&#x4E2A;&#x8FDC;&#x7A0B;&#x64CD;&#x4F5C;,&#x4E00;&#x5B9A;&#x4E0D;&#x80FD;&#x5305;&#x542B;&#x5728;&#x8BA2;&#x5355;&#x72B6;&#x6001;&#x66F4;&#x65B0;&#x7684;&#x4E8B;&#x52A1;&#x91CC;&#x9762;,&#x6709;&#x5F88;&#x591A;&#x4E25;&#x91CD;&#x7684;&#x95EE;&#x9898;,&#x8BE6;&#x7EC6;&#x8BF7;&#x770B;&lt;&#x5206;&#x5E03;&#x5F0F;&#x4EA4;&#x6613;&#x4E2D;&#x7684;&#x4E0D;&#x4E00;&#x81F4;&gt;</li>
<li>&#x4E00;&#x5B9A;&#x8981;&#x6709;<strong style="color:red">&#x660E;&#x786E;&#x7684;&#x6210;&#x529F;&#x6216;&#x8005;&#x5931;&#x8D25;</strong>,&#x624D;&#x80FD;&#x66F4;&#x65B0;&#x8BA2;&#x5355;&#x7ED3;&#x679C;</li>
<li>&#x4E00;&#x5B9A;&#x9700;&#x8981;&#x8003;&#x8651;<strong style="color:red">&#x5165;&#x8D26;&#x7ED3;&#x679C;&#x4E3A;null</strong>&#x7684;&#x60C5;&#x51B5;,&#x6BD4;&#x5982;&#x7F51;&#x7EDC;&#x88AB;&#x6316;&#x65AD;&#x4E86;</li>
<li>qiluTask&#x5728;&#x8FD9;&#x8FB9;&#x7684;&#x73A9;&#x6CD5;,&#x5C31;&#x662F;&#x5728;&#x6CA1;&#x6709;&#x660E;&#x786E;&#x7ED3;&#x679C;&#x7684;&#x524D;&#x63D0;&#x4E0B;,&#x8BA2;&#x5355;&#x7684;&#x7ED3;&#x679C;&#x4E5F;&#x4E0D;&#x80FD;&#x66F4;&#x65B0;,&#x89E6;&#x53D1;&#x4E00;&#x4E2A;&#x5F02;&#x6B65;&#x4EFB;&#x52A1;&#x5E2E;&#x6211;&#x53BB;&#x8F6E;&#x8BE2;,&#x81F3;&#x4E8E;&#x8FD9;&#x4E2A;&#x4EFB;&#x52A1;&#x662F;&#x96C6;&#x7FA4;&#x4E2D;&#x7684;&#x54EA;&#x53F0;&#x673A;&#x5668;&#x505A;,&#x968F;&#x4FBF;</li>
</ul>
<h3 id="&#x8DD1;p&#x65B9;&#x6848;&#x4E00;">&#x8DD1;P&#x65B9;&#x6848;&#x4E00;</h3>
<p>&#x6BCF;&#x65E5;&#x7684;&#x5B9A;&#x65F6;&#x8DD1;P,&#x89E3;&#x51B3;&#x65B9;&#x6848;&#x4E00;,&#x5728;&#x6BCF;&#x5929;&#x7684;&#x968F;&#x4FBF;&#x4EC0;&#x4E48;&#x65F6;&#x5019;(&#x6BD4;&#x5982;&#x51CC;&#x6668;2&#x70B9;),&#x89E6;&#x53D1;&#x4E00;&#x4E2A;springTask,&#x8C03;&#x7528;<code>qiluTaskService.addTask</code>&#x65B9;&#x6CD5;,&#x5411;qiluTask&#x6CE8;&#x518C;&#x4ECA;&#x5929;&#x7684;&#x4EFB;&#x52A1;.&#x8FD9;&#x8FB9;&#x8981;&#x6CE8;&#x610F;&#x4E00;&#x4E0B;2&#x70B9;</p>
<ol>
<li>&#x4ECA;&#x5929;&#x7684;&#x4EFB;&#x52A1;&#x8981;&#x4E0D;&#x8981;&#x4F9D;&#x8D56;&#x6628;&#x5929;&#x7684;&#x4EFB;&#x52A1;??&#x4EC0;&#x4E48;&#x610F;&#x601D;,&#x5C31;&#x662F;&#x6628;&#x5929;&#x7684;&#x4EFB;&#x52A1;&#x5982;&#x679C;&#x51FA;&#x73B0;&#x5404;&#x79CD;&#x95EE;&#x9898;&#x4EE5;&#x540E;,&#x4ECA;&#x5929;&#x7684;&#x4EFB;&#x52A1;&#x8FD8;&#x8981;&#x4E0D;&#x8981;&#x8DD1;,&#x662F;&#x7B49;&#x7740;&#x8FD8;&#x662F;&#x4E0D;&#x7BA1;&#x4E4B;&#x524D;&#x7684;&#x8BB0;&#x5F55;.</li>
<li>&#x4ECA;&#x5929;&#x7684;&#x540E;&#x7EED;&#x4EFB;&#x52A1;&#x8981;&#x4E0D;&#x8981;&#x4F9D;&#x8D56;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;???</li>
</ol>
<p>&#x5047;&#x8BBE;&#x4ECA;&#x5929;&#x7684;&#x8DD1;P&#x6D41;&#x7A0B;&#x662F;&#x8FD9;&#x6837;&#x7684;</p>
<p></p><div class="mermaid">
graph LR
&#x524D;&#x7F6E;&#x4EFB;&#x52A1;1--&gt;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;2
&#x524D;&#x7F6E;&#x4EFB;&#x52A1;2--&gt;&#x4E3B;&#x4EFB;&#x52A1;
&#x4E3B;&#x4EFB;&#x52A1;--&gt;&#x6536;&#x5C3E;&#x4EFB;&#x52A1;
</div>
&#x6211;&#x4EEC;&#x7684;&#x4EE3;&#x7801;&#x53EF;&#x4EE5;&#x8FD9;&#x4E48;&#x5B9E;&#x73B0;<p></p>
<pre class="language-"><code class="lang-java">qiluTaskService<span class="token punctuation">.</span><span class="token function">addTask</span><span class="token punctuation">(</span><span class="token string">&quot;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;1&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;&#x65E5;&#x671F;&quot;</span> <span class="token punctuation">,</span> handler <span class="token punctuation">,</span> map <span class="token punctuation">,</span> <span class="token function">second</span><span class="token punctuation">(</span>&#x6267;&#x884C;&#x65F6;&#x95F4;<span class="token operator">-</span>now<span class="token punctuation">)</span> <span class="token punctuation">,</span> <span class="token number">5</span> <span class="token punctuation">,</span> <span class="token number">5</span> <span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token punctuation">{</span><span class="token string">&quot;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;1&quot;</span><span class="token punctuation">,</span>&#x6628;&#x5929;&#x7684;&#x65E5;&#x671F;<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
qiluTaskService<span class="token punctuation">.</span><span class="token function">addTask</span><span class="token punctuation">(</span><span class="token string">&quot;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;2&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;&#x65E5;&#x671F;&quot;</span> <span class="token punctuation">,</span> handler2 <span class="token punctuation">,</span> map <span class="token punctuation">,</span> <span class="token function">second</span><span class="token punctuation">(</span>&#x6267;&#x884C;&#x65F6;&#x95F4;<span class="token operator">-</span>now<span class="token punctuation">)</span> <span class="token punctuation">,</span> <span class="token number">5</span> <span class="token punctuation">,</span> <span class="token number">5</span> <span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token punctuation">{</span><span class="token string">&quot;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;1&quot;</span><span class="token punctuation">,</span>&#x4ECA;&#x5929;&#x7684;&#x65E5;&#x671F;<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
qiluTaskService<span class="token punctuation">.</span><span class="token function">addTask</span><span class="token punctuation">(</span><span class="token string">&quot;&#x4E3B;&#x4EFB;&#x52A1;&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;&#x65E5;&#x671F;&quot;</span> <span class="token punctuation">,</span> handler3 <span class="token punctuation">,</span> map <span class="token punctuation">,</span> <span class="token function">second</span><span class="token punctuation">(</span>&#x6267;&#x884C;&#x65F6;&#x95F4;<span class="token operator">-</span>now<span class="token punctuation">)</span> <span class="token punctuation">,</span> <span class="token number">5</span> <span class="token punctuation">,</span> <span class="token number">5</span> <span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token punctuation">{</span><span class="token string">&quot;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;2&quot;</span><span class="token punctuation">,</span>&#x4ECA;&#x5929;&#x7684;&#x65E5;&#x671F;<span class="token punctuation">}</span> <span class="token punctuation">,</span> <span class="token punctuation">{</span><span class="token string">&quot;&#x4E3B;&#x4EFB;&#x52A1;&quot;</span><span class="token punctuation">,</span>&#x6628;&#x5929;&#x7684;&#x65E5;&#x671F;<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
qiluTaskService<span class="token punctuation">.</span><span class="token function">addTask</span><span class="token punctuation">(</span><span class="token string">&quot;&#x6536;&#x5C3E;&#x4EFB;&#x52A1;&quot;</span><span class="token punctuation">,</span><span class="token string">&quot;&#x65E5;&#x671F;&quot;</span> <span class="token punctuation">,</span> handler4 <span class="token punctuation">,</span> map <span class="token punctuation">,</span> <span class="token function">second</span><span class="token punctuation">(</span>&#x6267;&#x884C;&#x65F6;&#x95F4;<span class="token operator">-</span>now<span class="token punctuation">)</span> <span class="token punctuation">,</span> <span class="token number">5</span> <span class="token punctuation">,</span> <span class="token number">5</span> <span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token punctuation">{</span><span class="token string">&quot;&#x4E3B;&#x4EFB;&#x52A1;&quot;</span><span class="token punctuation">,</span>&#x4ECA;&#x5929;&#x7684;&#x65E5;&#x671F;<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>That&apos;s IT!!!&#x6709;&#x4E9B;&#x7EC6;&#x8282;&#x8BF4;&#x660E;&#x4E0B;</p>
<ul>
<li>&#x524D;&#x7F6E;&#x4EFB;&#x52A1;1&#x4F9D;&#x8D56;&#x4E8E;&#x81EA;&#x5DF1;&#x7684;&#x6628;&#x5929;&#x7684;&#x4EFB;&#x52A1;,&#x5176;&#x4ED6;&#x7684;&#x4EFB;&#x52A1;&#x90FD;&#x4F9D;&#x8D56;&#x4E8E;&#x8FD9;&#x4E2A;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;1</li>
<li>&#x5982;&#x679C;&#x6628;&#x5929;&#x7684;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;1,&#x56E0;&#x4E3A;&#x5404;&#x79CD;&#x539F;&#x56E0;,&#x539F;&#x672C;&#x4ECA;&#x5929;&#x51CC;&#x6668;2&#x70B9;&#x7684;&#x4EFB;&#x52A1;,&#x6700;&#x7EC8;&#x6267;&#x884C;&#x7684;&#x65F6;&#x95F4;&#x662F;&#x660E;&#x5929;&#x7684;&#x51CC;&#x6668;4&#x70B9;,&#x4E0A;&#x8FF0;&#x914D;&#x7F6E;,&#x4F1A;&#x5728;&#x660E;&#x5929;&#x7684;&#x51CC;&#x6668;4&#x70B9;&#x4E4B;&#x540E;&#x7684;qiluTask&#x8865;&#x5355;&#x4EFB;&#x52A1;&#x4E2D;,&#x5F00;&#x59CB;&#x6267;&#x884C;&#x4ECA;&#x5929;&#x7684;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;1,&#x540E;&#x7EED;&#x4EFB;&#x52A1;&#x4E5F;&#x4F1A;&#x8DDF;&#x4E0A;</li>
<li>&#x81F3;&#x4E8E;&#x4E3B;&#x4EFB;&#x52A1;&#x6765;&#x8BF4;,&#x4E0D;&#x4F46;&#x4F9D;&#x8D56;&#x4E86;&#x4ECA;&#x5929;&#x7684;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;,&#x8FD8;&#x4F9D;&#x8D56;&#x4E86;&#x6628;&#x5929;&#x7684;&#x4E3B;&#x4EFB;&#x52A1;,&#x90A3;&#x4E2A;&#x4F9D;&#x8D56;&#x53EA;&#x662F;&#x4E00;&#x4E2A;&#x53CC;&#x91CD;&#x4FDD;&#x9669;</li>
</ul>
<p>&#x901A;&#x8FC7;&#x4E0A;&#x8FF0;&#x65B9;&#x6848;,&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x505A;&#x5230;</p>
<ol>
<li>&#x6BCF;&#x5929;&#x7684;&#x8DD1;P&#x7ED3;&#x679C;&#x662F;&#x80FD;&#x770B;&#x5230;&#x7684;,&#x800C;&#x4E14;&#x53EF;&#x4EE5;&#x76D1;&#x63A7;</li>
<li>&#x5982;&#x679C;&#x4E3B;&#x4EFB;&#x52A1;&#x6CA1;&#x6709;&#x8DD1;&#x5B8C;,&#x662F;&#x56E0;&#x4E3A;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;2&#x6CA1;&#x8DD1;&#x5B8C;,&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5355;&#x72EC;&#x4FEE;&#x6539;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;2&#x7684;&#x72B6;&#x6001;,&#x8BA9;&#x524D;&#x7F6E;&#x4EFB;&#x52A1;2&#x6267;&#x884C;&#x5B8C;&#x6210;&#x4EE5;&#x540E;,&#x4F1A;&#x81EA;&#x52A8;&#x89E6;&#x53D1;&#x4E3B;&#x4EFB;&#x52A1;.</li>
</ol>
<h2 id="&#x8D85;&#x7EA7;&#x597D;&#x7528;&#x7684;taskno&#x751F;&#x6210;&#x5668;">&#x8D85;&#x7EA7;&#x597D;&#x7528;&#x7684;taskNo&#x751F;&#x6210;&#x5668;</h2>
<p>&#x5982;&#x679C;&#x4E00;&#x4E2A;&#x4EFB;&#x52A1;,&#x9700;&#x8981;&#x6BCF;5&#x5206;&#x949F;&#x6267;&#x884C;&#x4E00;&#x6B21;,&#x5982;&#x679C;&#x4F7F;&#x7528;qiluTask&#x6765;&#x6267;&#x884C;,&#x9700;&#x8981;&#x4E00;&#x4E2A;&#x7A33;&#x5B9A;&#x7684;&#x4EFB;&#x52A1;&#x53F7;,&#x8FD9;&#x4E2A;&#x4EFB;&#x52A1;&#x53F7;,&#x9700;&#x8981;5&#x5206;&#x949F;&#x5185;&#x662F;&#x552F;&#x4E00;&#x7684;.</p>
<p>&#x53EF;&#x4EE5;&#x501F;&#x52A9;&#x4E8E;spring&#x4E2D;<code>org.springframework.scheduling.support.CronSequenceGenerator</code>&#x7684;&#x7C7B;,&#x8FD9;&#x4E2A;&#x7C7B;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;new&#x51FA;&#x6765;,&#x5728;&#x6784;&#x9020;&#x51FD;&#x6570;&#x4E2D;,&#x53EF;&#x4EE5;&#x4F20;&#x5165;&#x4E00;&#x4E2A;cron&#x8868;&#x8FBE;&#x5F0F;,&#x901A;&#x8FC7;nextDate&#x65B9;&#x6CD5;,&#x5F97;&#x5230;&#x4E00;&#x4E2A;date,&#x518D;&#x901A;&#x8FC7;date&#x4FDD;&#x7559;&#x5230;5&#x5206;&#x949F;&#x7EA7;&#x522B;,&#x6240;&#x4EE5;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x6BCF;&#x5206;&#x949F;&#x90FD;&#x5C1D;&#x8BD5;&#x751F;&#x6210;&#x4E00;&#x4E2A;&#x4EFB;&#x52A1;,&#x800C;&#x5728;5&#x5206;&#x949F;&#x5185;&#x53EF;&#x4EE5;&#x5F97;&#x5230;&#x540C;&#x6837;&#x4E00;&#x4E2A;&#x4EFB;&#x52A1;&#x53F7;.</p>
<pre class="language-"><code class="lang-java"><span class="token comment">//&#x9488;&#x5BF9;&#x5468;&#x671F;&#x6027;&#x6CA1;&#x6709;&#x5177;&#x4F53;taskNo,&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x65F6;&#x95F4;&#x751F;&#x6210;&#x7C7B;&#x4F3C;&#x6279;&#x6B21;&#x53F7;,&#x4F5C;&#x4E3A;taskNo</span>
<span class="token comment">//&#x4E0B;&#x9762;&#x7684;&#x4EE3;&#x7801;,&#x5C31;&#x662F;&#x6BCF;&#x5206;&#x949F;&#x7684;23&#x79D2;,&#x4F1A;&#x751F;&#x6210;&#x4E00;&#x4E2A;taskNo,&#x81F3;&#x4E8E;&#x5F53;&#x524D;&#x7684;&#x4EE3;&#x7801;&#x5565;&#x65F6;&#x5019;&#x88AB;&#x89E6;&#x53D1;,&#x53EF;&#x4EE5;&#x5FFD;&#x7565;</span>
<span class="token class-name">CronSequenceGenerator</span> generator <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">CronSequenceGenerator</span><span class="token punctuation">(</span><span class="token string">&quot;23 0/1 * * * ?&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token class-name">String</span> taskNo <span class="token operator">=</span> format<span class="token punctuation">.</span><span class="token function">format</span><span class="token punctuation">(</span>generator<span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Date</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<h2 id="qilutask&#x7684;&#x9650;&#x5236;">qiluTask&#x7684;&#x9650;&#x5236;</h2>
<ol>
<li>&#x6CE8;&#x610F;<strong style="color:red">&#x670D;&#x52A1;&#x5668;&#x7684;&#x65F6;&#x95F4;</strong>.&#x91C7;&#x7528;&#x4E0A;&#x8FF0;&#x7684;&#x65B9;&#x5F0F;,&#x4F1A;&#x4F9D;&#x8D56;&#x4E8E;&#x670D;&#x52A1;&#x5668;&#x7684;&#x65F6;&#x95F4;.&#x5982;&#x679C;<strong style="color:red">&#x670D;&#x52A1;&#x5668;&#x7684;&#x65F6;&#x95F4;</strong>&#x4E0D;&#x6B63;&#x786E;,&#x4F1A;&#x5BFC;&#x81F4;&#x4EFB;&#x52A1;&#x5728;&#x4E0D;&#x540C;&#x7684;&#x65F6;&#x95F4;&#x6267;&#x884C;,&#x8FD9;&#x79CD;&#x884C;&#x4E3A;&#x7B97;&#x662F;&#x67D0;&#x79CD;&#x9ED1;&#x5BA2;&#x884C;&#x4E3A;(&#x5F53;&#x5E74;&#x7684;&#x5343;&#x5E74;&#x866B;&#x7684;&#x4E00;&#x4E2A;&#x4E34;&#x65F6;&#x89E3;&#x51B3;&#x65B9;&#x6848;),&#x4E0D;&#x8981;&#x60CA;&#x614C;,&#x5C31;&#x7B97;&#x4EFB;&#x52A1;&#x5DF2;&#x7ECF;&#x6267;&#x884C;,&#x4E5F;&#x4E0D;&#x4F1A;&#x5BFC;&#x81F4;&#x91CD;&#x590D;&#x6267;&#x884C;,&#x56E0;&#x4E3A;qiluTask&#x4F7F;&#x7528;&#x6570;&#x636E;&#x5E93;&#x7684;&#x8BB0;&#x5F55;&#x6765;&#x5B9E;&#x73B0;&#x9632;&#x91CD;.</li>
<li>&#x4F7F;&#x7528;qiluTask&#x4EE5;&#x540E;,&#x53EA;&#x9700;&#x8981;&#x521A;&#x6539;&#x5BF9;&#x5E94;&#x7684;&#x4EFB;&#x52A1;&#x72B6;&#x6001;&#x548C;&#x4E0B;&#x6B21;&#x6267;&#x884C;&#x65F6;&#x95F4;,&#x5C31;&#x80FD;&#x8BA9;&#x4EFB;&#x52A1;&#x88AB;&#x968F;&#x65F6;&#x8C03;&#x8D77;.&#x8FD9;&#x4E2A;&#x529F;&#x80FD;&#x614E;&#x7528;,&#x4E00;&#x5B9A;&#x8981;&#x786E;&#x8BA4;&#x5BF9;&#x5E94;&#x7684;&#x4E1A;&#x52A1;&#x529F;&#x80FD;&#x6CA1;&#x6709;&#x91CD;&#x590D;&#x5224;&#x65AD;,&#x6216;&#x8005;&#x6CA1;&#x6709;&#x6267;&#x884C;. </li>
</ol>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; senvon 2020 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">Bilibili,&#x5934;&#x6761;&#x53F7;,&#x5FAE;&#x4FE1;&#x53F7;&#xFF1A;&#x8BF7;&#x641C;&#x7D22;  &#x968F;senvon&#x98DE;
2021-09-01 15:23:48
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="baseReadme.html" class="navigation navigation-prev " aria-label="Previous page: 基础包介绍">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="cache-readme.html" class="navigation navigation-next " aria-label="Next page: qilucache">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"qilu-task","level":"1.3.1","depth":2,"next":{"title":"qilucache","level":"1.3.2","depth":2,"path":"base/cache-readme.md","ref":"base/cache-readme.md","articles":[]},"previous":{"title":"基础包介绍","level":"1.3","depth":1,"path":"base/baseReadme.md","ref":"base/baseReadme.md","articles":[{"title":"qilu-task","level":"1.3.1","depth":2,"path":"base/qiluTask-readme.md","ref":"base/qiluTask-readme.md","articles":[]},{"title":"qilucache","level":"1.3.2","depth":2,"path":"base/cache-readme.md","ref":"base/cache-readme.md","articles":[]},{"title":"qilu-mybatis","level":"1.3.3","depth":2,"path":"base/qiluMybatis-readme.md","ref":"base/qiluMybatis-readme.md","articles":[]},{"title":"qilu-logTrace","level":"1.3.4","depth":2,"path":"base/logTrace-readme.md","ref":"base/logTrace-readme.md","articles":[]},{"title":"qilu-export","level":"1.3.5","depth":2,"path":"base/qilu-export-readme.md","ref":"base/qilu-export-readme.md","articles":[]},{"title":"qilu-http-service","level":"1.3.6","depth":2,"path":"base/httpService-readme.md","ref":"base/httpService-readme.md","articles":[]},{"title":"qilu-validate","level":"1.3.7","depth":2,"path":"base/validateReadme.md","ref":"base/validateReadme.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["search-plus","-lunr","-search","tbfed-pagefooter","simple-page-toc","insert-logo","back-to-top-button","toggle-chapters","code","lightbox","copy-code-button","search-pro","emphasize","splitter","mermaid-gb3","-sharing","sharing-plus","prism","-highlight","flexible-alerts","page-toc-button","baidu","pageview-count","bilibili","donate","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy senvon 2020","modify_label":"Bilibili,头条号,微信号：请搜索  随senvon飞"},"prism":{},"emphasize":{},"livereload":{},"simple-page-toc":{"maxDepth":5,"skipFirstH1":true},"splitter":{},"search-pro":{},"bilibili":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"code":{"copyButtons":true},"donate":{"alipay":"images/toutiao.jpg","alipayText":"头条号","button":"联系方式","title":"联系方式","wechat":"images/weixin.PNG","wechatText":"公众号"},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"lightbox":{"jquery":true,"sameUuid":false},"page-toc-button":{"maxTocDepth":5,"minTocSize":2},"back-to-top-button":{},"pageview-count":{},"flexible-alerts":{"danger":{"className":"danger","icon":"fa fa-ban","label":"Attention"},"note":{"className":"info","icon":"fa fa-info-circle","label":"Note"},"style":"flat","tip":{"className":"tip","icon":"fa fa-lightbulb-o","label":"Tip"},"warning":{"className":"warning","icon":"fa fa-exclamation-triangle","label":"Warning"}},"copy-code-button":{},"baidu":{"token":"51550945f89f43511a44753249ab6675"},"sharing":{"qq":true,"all":["douban","qq","qzone","weibo"],"douban":false,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":true,"linkedin":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"toggle-chapters":{},"insert-logo":{"style":"background: none; height: 170px; width: 200px","url":"images/logo3.jpg"},"search-plus":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"启路框架-使用手册","language":"zh-hans","backplugin":["lightbox"],"gitbook":"*","description":"启路框架-使用手册"},"file":{"path":"base/qiluTask-readme.md","mtime":"2021-09-01T07:23:48.745Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-10-19T02:57:27.717Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-insert-logo/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lightbox/js/lightbox.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-mermaid-gb3/book/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-flexible-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-baidu/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    <script src="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.min.js"></script>

    </body>
</html>

